﻿using Microsoft.EntityFrameworkCore;
using Microsoft.EntityFrameworkCore.Metadata.Builders;
using StarsAdmin.Core.DB.Entities;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace StarsAdmin.Core.DB.Configs
{
    public class DictConfig : IEntityTypeConfiguration<DictEntity>
    {
        public void Configure(EntityTypeBuilder<DictEntity> builder)
        {
            builder.ToTable("T_Dicts");
            builder.Property(p => p.Name).IsRequired().HasMaxLength(64);
            builder.Property(p => p.Code).IsRequired().HasMaxLength(64);
            builder.Property(p => p.Value).IsRequired().HasMaxLength(64);
            builder.Property(p => p.Description).IsRequired(false).HasMaxLength(256);
        }
    }
}